package rozetka.driver;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;

public class DriverFactory {

	public static String FIREFOX = "firefox";

	public static String CHROME = "Chrome";

	public static String IE = "IE";

	public static WebDriver getDriver(String browserName) {
		if (FIREFOX.equals(browserName)) {
			return new FirefoxDriver(); 
		}
		if (CHROME.equals(browserName)) {
			System.setProperty("webdriver.chrome.driver", "soft/chromedriver.exe");
			return new ChromeDriver(); 
		}
		if (IE.equals(browserName)) {
			System.setProperty("webdriver.ie.driver", "C:/Program Files/Internet Explorer/iexplore.exe");
			return new InternetExplorerDriver();
		}
		
		return new FirefoxDriver(); 
	}
}
